#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 110, M = 10010;

int n, s;
int dp[N][M], a[N], b[N];
int fa[N][M];

void solve(){
    vector<string> res;
    int x = n, y = s;
    while(fa[x][y]){
        int t = fa[x][y];
        int nx = t / M, ny = t % M;
        if(y - ny == a[x]){
            res.push_back("H");
        }else{
            res.push_back("T");
        }
        x = nx, y = ny;
    }

    if(y == a[x]){
        res.push_back("H");
    }else{
        res.push_back("T");
    }


    reverse(res.begin(), res.end());
    for(int i = 0; i < res.size(); i ++){
        cout << res[i];
    }
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false); 
    cin.tie(nullptr);

    cin >> n >> s;
    for(int i = 1; i <= n; i ++) cin >> a[i] >> b[i];


    dp[0][0] = 1;
    for(int i = 1; i <= n;  i++){
        for(int j = 0; j <= 10000; j ++){
            if(j >= a[i] && dp[i - 1][j - a[i]] == 1){
                fa[i][j] = (i - 1) * M + j - a[i];
                dp[i][j] = 1;
                continue;
            }

            if(j >= b[i] && dp[i - 1][j - b[i]] == 1){
                fa[i][j] = (i - 1) * M + j - b[i];
                dp[i][j] = 1;
                continue;
            }
        }
    }

    if(dp[n][s] == 1){
        cout << "Yes" << '\n';
        solve();
    }else{
        cout << "No" << '\n';
    }



    return 0;
}